package jschool.ui.materia;

import java.awt.Color;
import java.awt.Rectangle;

import javax.swing.BorderFactory;
import javax.swing.ComboBoxModel;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import java.awt.Dimension;
import javax.swing.JButton;
import javax.swing.border.TitledBorder;
import java.awt.Font;

public class PanelMateria extends JPanel {

	private static final long serialVersionUID = 1L;
	private JPanel jContentPane = null;
	private JPanel panelMateria = null;
	private JLabel lblNombreMateria = null;
	private JTextField txtNombreMateria = null;
	private JLabel lblDescripcion = null;
	private JScrollPane jspDescripcion = null;
	private JTextArea txtDescripcion = null;
	private JLabel lblTipoAula = null;
	private JComboBox cbbTipoDeAula = null;
	private ComboBoxModel modelo = null;
	private JButton btnAceptar = null;
	private JButton btnCancelar = null;

	/**
	 * This is the default constructor
	 */
	public PanelMateria() {
		super();
		initialize();
	}

	/**
	 * This method initializes this
	 * 
	 * @return void
	 */
	private void initialize() {
		modelo = new DefaultComboBoxModel(new String[] { "Lab.Fisica",
				"Lab.Quimica", "Lab.Informatico", "Aula Normal" });
		this.setSize(434, 302);
		this.setLayout(null);
		this.add(getPanelMateria(), null);
		this.add(getBtnAceptar(), null);
		this.add(getBtnCancelar(), null);
		this.add(getPanelMateria());
	}

	private JLabel getLblNombreMateria(){
		return lblNombreMateria;
	}
	
	private JLabel getLblDescripcion(){
		return lblDescripcion;
	}
	
	private JLabel getLblTipoAula(){
		return lblTipoAula;
	}
	
	private JPanel getPanelMateria() {
		if (panelMateria == null) {
			lblTipoAula = new JLabel();
			lblTipoAula.setBounds(new Rectangle(5, 200, 116, 27));
			lblTipoAula.setText("Tipo de Aula :");
			lblDescripcion = new JLabel();
			lblDescripcion.setBounds(new Rectangle(7, 95, 116, 27));
			lblDescripcion.setText("Descripcion :");
			lblNombreMateria = new JLabel();
			lblNombreMateria.setBounds(new Rectangle(7, 40, 116, 27));
			lblNombreMateria.setText("Nombre Materia :");
			panelMateria = new JPanel();
			panelMateria.setLayout(null);
			panelMateria.setBounds(new Rectangle(7, 7, 402, 253));
			panelMateria.setBorder(BorderFactory.createTitledBorder(
					BorderFactory.createLineBorder(Color.black, 2), "Materias",
					TitledBorder.DEFAULT_JUSTIFICATION,
					TitledBorder.DEFAULT_POSITION, new Font("Comic Sans MS",
							Font.BOLD, 12), Color.black));
			panelMateria.add(lblNombreMateria, null);
			panelMateria.add(getTxtNombreMateria(), null);
			panelMateria.add(lblDescripcion, null);
			panelMateria.add(getJspDescripcion(), null);
			panelMateria.add(lblTipoAula, null);
			panelMateria.add(getCbbTipoDeAula(), null);
		}
		return panelMateria;
	}

	/**
	 * This method initializes txtNombreMateria
	 * 
	 * @return javax.swing.JTextField
	 */
	private JTextField getTxtNombreMateria() {
		if (txtNombreMateria == null) {
			txtNombreMateria = new JTextField();
			txtNombreMateria.setBorder(BorderFactory.createLineBorder(
					Color.black, 1));
			txtNombreMateria.setBounds(new Rectangle(133, 40, 145, 27));
		}
		return txtNombreMateria;
	}

	/**
	 * This method initializes jspDescripcion
	 * 
	 * @return javax.swing.JScrollPane
	 */
	private JScrollPane getJspDescripcion() {
		if (jspDescripcion == null) {
			jspDescripcion = new JScrollPane();
			jspDescripcion.setBounds(new Rectangle(134, 81, 243, 93));
			jspDescripcion.setViewportView(getTxtDescripcion());
		}
		return jspDescripcion;
	}

	/**
	 * This method initializes txtDescripcion
	 * 
	 * @return javax.swing.JTextArea
	 */
	private JTextArea getTxtDescripcion() {
		if (txtDescripcion == null) {
			txtDescripcion = new JTextArea();
			txtDescripcion.setBorder(BorderFactory.createLineBorder(
					Color.black, 1));
		}
		return txtDescripcion;
	}

	/**
	 * This method initializes cbbTipoDeAula
	 * 
	 * @return javax.swing.JComboBox
	 */
	private JComboBox getCbbTipoDeAula() {
		if (cbbTipoDeAula == null) {
			cbbTipoDeAula = new JComboBox();
			cbbTipoDeAula.setModel(modelo);
			cbbTipoDeAula.setBounds(new Rectangle(140, 200, 145, 27));
		}
		return cbbTipoDeAula;
	}

	/**
	 * This method initializes btnAceptar
	 * 
	 * @return javax.swing.JButton
	 */
	private JButton getBtnAceptar() {
		if (btnAceptar == null) {
			btnAceptar = new JButton();
			btnAceptar.setBounds(new Rectangle(175, 267, 108, 27));
			btnAceptar.setText("Aceptar");
		}
		return btnAceptar;
	}

	/**
	 * This method initializes btnCancelar
	 * 
	 * @return javax.swing.JButton
	 */
	private JButton getBtnCancelar() {
		if (btnCancelar == null) {
			btnCancelar = new JButton();
			btnCancelar.setBounds(new Rectangle(301, 267, 108, 27));
			btnCancelar.setText("Cancelar");
		}
		return btnCancelar;
	}

} // @jve:decl-index=0:visual-constraint="10,10"
